<?php

namespace App\Kuafu\Guanyuan\Model;

use App\Kuafu\Base\Model\BaseModel;
use Illuminate\Support\Facades\DB;

class ShopDailyWaiMaiRateModel extends BaseModel
{
    protected $connection = 'mysqlGuanYuanDish';
    protected $table      = 'shop_daily_waimai_rate';

    /**
     * 格式化评分
     * @param $score
     * @return float
     */
    public static function formatScore($score): float
    {
        $score = round($score, 1);

        // 把0.0转成0
        if ($score == 0) {
            $score = 0;
        }

        return $score;
    }
}
